package com.googlecode.worktools.utils;



import java.awt.Component;

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

/**
 * 界面工具类
 * @author Kobe Su,2009-11-18
 */
public class UIUtils {

	public static void showSuccessMsg(Component component,String msg) {
		JOptionPane.showMessageDialog(component,msg);
	}
	
	public static void showErrorMsg(Component component,String msg) {
		JOptionPane.showMessageDialog(component,msg,"出错了",JOptionPane.ERROR_MESSAGE);
	}
	
    /** 
     * Returns an ImageIcon, or null if the path was invalid. 
     */
	public static ImageIcon createImageIcon(String path) {
        java.net.URL imgURL = UIUtils.class.getResource(path);
        if (imgURL != null) {
            return new ImageIcon(imgURL);
        } else {
            System.err.println("Couldn't find file: " + path);
            return null;
        }
    }
	
	
	public static void main(String[] args) {
		

	}

}
